package thread;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author zxl
 * @version 1.0
 * @date 2021/10/26 17:27
 */
public class ThreadSleep {
    public static void main(String[] args) {
        test1();
    }
    public static void test1(){
        try {
            while (true){
                Thread.sleep(1000);
                Date date = new Date();
                System.out.println(new SimpleDateFormat("HH:mm:ss").format(date));
            }
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
